package com.escom.utils;

import android.content.SharedPreferences;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.escom.activity.ConsultaFragment;
import com.escom.activity.DatosGrFragment;
import com.escom.activity.HistoriaFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Carlos on 15/04/2014.
 */
public class TabsAdapterExpediente extends FragmentPagerAdapter {

    private List<Fragment> tabFragment;

    public TabsAdapterExpediente(FragmentManager fm, SharedPreferences sharedpreferences) {
        super(fm);
        tabFragment = new ArrayList<Fragment>();

        DatosGrFragment datosGrFragment = new DatosGrFragment();

        HistoriaFragment historiaFragment = new HistoriaFragment();

        ConsultaFragment consultaFragment = new ConsultaFragment();

        tabFragment.add(datosGrFragment);
        tabFragment.add(historiaFragment);
        tabFragment.add(consultaFragment);
    }

    @Override
    public Fragment getItem(int index) {

        return tabFragment.get(index);
    }

    @Override
    public int getCount() {
        // get item count - equal to number of tabs
        return tabFragment.size();
    }


}